#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTreeView>
#include <QSplitter>
#include <QVBoxLayout>
#include "elfmodel.h"
#include "detailview.h"

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow() = default;

protected:
    void dragEnterEvent(QDragEnterEvent *event) override;
    void dropEvent(QDropEvent *event) override;

private slots:
    void openFile();
    void exportJson();
    void exportText();
    void showAbout();
    void onTreeViewClicked(const QModelIndex &index);

private:
    void createActions();
    void createMenus();
    void createToolBar();
    void createStatusBar();
    void loadFile(const QString &filename);
    
    QTreeView *m_treeView;
    DetailView *m_detailView;
    ElfModel *m_model;
    
    QAction *m_openAction;
    QAction *m_exportJsonAction;
    QAction *m_exportTextAction;
    QAction *m_exitAction;
    QAction *m_aboutAction;
};

#endif // MAINWINDOW_H
